package com.ln.asset.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.ln.asset.core.mapper.OmMapper;
import com.ln.asset.core.pojo.InsAdd;
import com.ln.asset.core.mapper.InsAddMapper;
import com.ln.asset.core.service.InsAddService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cuixiaoxin
 * @since 2022-04-29
 */
@Service
public class InsAddServiceImpl extends ServiceImpl<InsAddMapper, InsAdd> implements InsAddService {

    @Resource
    private OmMapper omMapper;
    @Resource
    private InsAddMapper insAddMapper;
    @Override
    public Integer addAssetcj(InsAdd insAdd) {
        Integer num1=baseMapper.insert(insAdd);
        return num1;
    }

    @Override
    public Integer listaddAssetcj(List<InsAdd> insAdds) {
        for(int i=0;i<insAdds.size();i++){
            insAdds.get(i).setInjstart(1);
            insAdds.get(i).setAtype(0);
        }
        Integer num1=baseMapper.listinsertAdds(insAdds);
        return num1;
    }

    @Override
    public Integer updateAssetCj(InsAdd insAdd) {
        Integer num1=insAddMapper.UpdateByIdSp(insAdd);
        return num1;
    }


}
